﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Profile;
using System.Configuration;
using System.Web;
using System.Xml.Serialization;

namespace Harrby.Web.Profile
{
    
    public class UserProfile : System.Web.Profile.ProfileBase
    {
        
        public UserProfile()
        {
        
        }

        public static UserProfile GetProfile()
        {
            return (UserProfile)HttpContext.Current.Profile;
        }

        public static UserProfile GetProfile(string username)
        {
            return (UserProfile)Create(username);
        }
        
        [ProfileProvider("Harrby")]
        public User User { get { return (User)GetPropertyValue("PersonalInformation"); } set { SetPropertyValue("PersonalInformation", value); } }

        
        [ProfileProvider("Harrby")]
        [SettingsSerializeAs(SettingsSerializeAs.Xml)]
        public EmailCollection EmailCollection { get { return (EmailCollection)GetPropertyValue("EmailCollection"); } set { SetPropertyValue("EmailCollection", value); } }

        
        [SettingsSerializeAs(SettingsSerializeAs.Xml)]
        [ProfileProvider("Harrby")]
        public WebPageCollection WebPageCollection { get { return (WebPageCollection)GetPropertyValue("WebPageCollection"); } set { SetPropertyValue("WebPageCollection", value); } }

        
        [SettingsSerializeAs(SettingsSerializeAs.Xml)]
        [ProfileProvider("Harrby")]
        public AddressCollection AddressCollection { get { return (AddressCollection)GetPropertyValue("AddressCollection"); } set { SetPropertyValue("AddressCollection", value); } }

        public override void Save()
        {
            base.Save();
        }
    }
}
